﻿///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version May  4 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "stdafx.h"

#include "wx/wxprec.h"

#include "SourceView.h"

#include "fbpLuaDebugger_gui.h"

///////////////////////////////////////////////////////////////////////////
using namespace LuaDebug;

MainFrameBase::MainFrameBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxSize( 640,480 ), wxDefaultSize );
	
	m_menubar1 = new wxMenuBar( 0 );
	m_menu1 = new wxMenu();
	wxMenuItem* m_menuItem1;
	m_menuItem1 = new wxMenuItem( m_menu1, wxID_EXIT, wxString( _("&Exit") ) + wxT('\t') + wxT("Shift+F5"), wxEmptyString, wxITEM_NORMAL );
	m_menu1->Append( m_menuItem1 );
	
	m_menubar1->Append( m_menu1, _("&File") ); 
	
	m_menu2 = new wxMenu();
	wxMenuItem* m_LocalWatch;
	m_LocalWatch = new wxMenuItem( m_menu2, ID_MENU_SHOW_LOCALWATCH, wxString( _("&LocalWatch") ) , wxEmptyString, wxITEM_NORMAL );
	m_menu2->Append( m_LocalWatch );
	
	wxMenuItem* m_GlobalWatch;
	m_GlobalWatch = new wxMenuItem( m_menu2, ID_MENU_SHOW_GLOBALWATCH, wxString( _("&GlobalWatch") ) , wxEmptyString, wxITEM_NORMAL );
	m_menu2->Append( m_GlobalWatch );
	
	wxMenuItem* m_RegistryWatch;
	m_RegistryWatch = new wxMenuItem( m_menu2, ID_MENU_SHOW_REGISTRYWATCH, wxString( _("&RegistryWatch") ) , wxEmptyString, wxITEM_NORMAL );
	m_menu2->Append( m_RegistryWatch );
	
	wxMenuItem* m_EnvironWatch;
	m_EnvironWatch = new wxMenuItem( m_menu2, ID_MENU_SHOW_ENVIRONWATCH, wxString( _("&EnvironWatch") ) , wxEmptyString, wxITEM_NORMAL );
	m_menu2->Append( m_EnvironWatch );
	
	wxMenuItem* m_StackWatch;
	m_StackWatch = new wxMenuItem( m_menu2, ID_MENU_SHOW_STACKWATCH, wxString( _("&StackWatch") ) , wxEmptyString, wxITEM_NORMAL );
	m_menu2->Append( m_StackWatch );
	
	wxMenuItem* m_Watch;
	m_Watch = new wxMenuItem( m_menu2, ID_MENU_SHOW_WATCH, wxString( _("&Watch") ) , wxEmptyString, wxITEM_NORMAL );
	m_menu2->Append( m_Watch );
	
	wxMenuItem* m_BacktraceView;
	m_BacktraceView = new wxMenuItem( m_menu2, ID_MENU_SHOW_BACKTRACEVIEW, wxString( _("&BacktraceView") ) , wxEmptyString, wxITEM_NORMAL );
	m_menu2->Append( m_BacktraceView );
	
	wxMenuItem* m_InteractiveView;
	m_InteractiveView = new wxMenuItem( m_menu2, ID_MENU_SHOW_INTERACTIVEVIEW, wxString( _("&InteractiveView") ) , wxEmptyString, wxITEM_NORMAL );
	m_menu2->Append( m_InteractiveView );
	
	wxMenuItem* m_OutputView;
	m_OutputView = new wxMenuItem( m_menu2, ID_MENU_SHOW_OUTPUTVIEW, wxString( _("&OutputView") ) , wxEmptyString, wxITEM_NORMAL );
	m_menu2->Append( m_OutputView );
	
	m_menubar1->Append( m_menu2, _("&View") ); 
	
	m_menu3 = new wxMenu();
	wxMenuItem* m_Break;
	m_Break = new wxMenuItem( m_menu3, ID_MENU_BREAK, wxString( _("&Break") ) + wxT('\t') + wxT("Shift+Pause"), wxEmptyString, wxITEM_NORMAL );
	m_menu3->Append( m_Break );
	
	wxMenuItem* m_Restart;
	m_Restart = new wxMenuItem( m_menu3, ID_MENU_RESTART, wxString( _("&Restart") ) + wxT('\t') + wxT("F5"), wxEmptyString, wxITEM_NORMAL );
	m_menu3->Append( m_Restart );
	
	wxMenuItem* m_separator1;
	m_separator1 = m_menu3->AppendSeparator();
	
	wxMenuItem* m_StepOver;
	m_StepOver = new wxMenuItem( m_menu3, ID_MENU_STEPOVER, wxString( _("Step &Over") ) + wxT('\t') + wxT("F6"), wxEmptyString, wxITEM_NORMAL );
	m_menu3->Append( m_StepOver );
	
	wxMenuItem* m_StepInto;
	m_StepInto = new wxMenuItem( m_menu3, ID_MENU_STEPINTO, wxString( _("Step &Into") ) + wxT('\t') + wxT("F7"), wxEmptyString, wxITEM_NORMAL );
	m_menu3->Append( m_StepInto );
	
	wxMenuItem* m_StepReturn;
	m_StepReturn = new wxMenuItem( m_menu3, ID_MENU_STEPRETURN, wxString( _("Step &Return") ) + wxT('\t') + wxT("F8"), wxEmptyString, wxITEM_NORMAL );
	m_menu3->Append( m_StepReturn );
	
	wxMenuItem* m_separator2;
	m_separator2 = m_menu3->AppendSeparator();
	
	wxMenuItem* m_ToggleBreakpoint;
	m_ToggleBreakpoint = new wxMenuItem( m_menu3, ID_MENU_TOGGLE_BREAKPOINT, wxString( _("&Toggle Breakpoint") ) + wxT('\t') + wxT("F9"), wxEmptyString, wxITEM_NORMAL );
	m_menu3->Append( m_ToggleBreakpoint );
	
	m_menubar1->Append( m_menu3, _("&Debug") ); 
	
	this->SetMenuBar( m_menubar1 );
	
	m_statusBar1 = this->CreateStatusBar( 2, wxST_SIZEGRIP|wxNO_BORDER, wxID_ANY );
	wxBoxSizer* bSizer2;
	bSizer2 = new wxBoxSizer( wxVERTICAL );
	
	m_splitter1 = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
	m_splitter1->SetSashGravity( 0.5 );
	m_splitter1->Connect( wxEVT_IDLE, wxIdleEventHandler( MainFrameBase::m_splitter1OnIdle ), NULL, this );
	m_splitter1->SetMinimumPaneSize( 120 );
	
	m_panel5 = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer3;
	bSizer3 = new wxBoxSizer( wxVERTICAL );
	
	m_sourceView = new LuaDebug::SourceView( m_panel5, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_DEFAULT_STYLE|wxNO_BORDER );
	
	bSizer3->Add( m_sourceView, 1, wxEXPAND, 5 );
	
	m_panel5->SetSizer( bSizer3 );
	m_panel5->Layout();
	bSizer3->Fit( m_panel5 );
	m_panel6 = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer4;
	bSizer4 = new wxBoxSizer( wxVERTICAL );
	
	m_wathView = new wxAuiNotebook( m_panel6, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_DEFAULT_STYLE|wxNO_BORDER );
	
	bSizer4->Add( m_wathView, 1, wxEXPAND, 5 );
	
	m_panel6->SetSizer( bSizer4 );
	m_panel6->Layout();
	bSizer4->Fit( m_panel6 );
	m_splitter1->SplitHorizontally( m_panel5, m_panel6, -120 );
	bSizer2->Add( m_splitter1, 1, wxEXPAND, 5 );
	
	this->SetSizer( bSizer2 );
	this->Layout();
	
	this->Centre( wxBOTH );
	
	// Connect Events
	this->Connect( wxEVT_IDLE, wxIdleEventHandler( MainFrameBase::OnIdle ) );
	this->Connect( wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Connect( ID_MENU_SHOW_LOCALWATCH, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Connect( ID_MENU_SHOW_GLOBALWATCH, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Connect( ID_MENU_SHOW_REGISTRYWATCH, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Connect( ID_MENU_SHOW_ENVIRONWATCH, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Connect( ID_MENU_SHOW_STACKWATCH, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Connect( ID_MENU_SHOW_WATCH, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Connect( ID_MENU_SHOW_BACKTRACEVIEW, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Connect( ID_MENU_SHOW_INTERACTIVEVIEW, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Connect( ID_MENU_SHOW_OUTPUTVIEW, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Connect( ID_MENU_BREAK, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Connect( ID_MENU_RESTART, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Connect( ID_MENU_STEPOVER, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Connect( ID_MENU_STEPINTO, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Connect( ID_MENU_STEPRETURN, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Connect( ID_MENU_TOGGLE_BREAKPOINT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
}

MainFrameBase::~MainFrameBase()
{
	// Disconnect Events
	this->Disconnect( wxEVT_IDLE, wxIdleEventHandler( MainFrameBase::OnIdle ) );
	this->Disconnect( wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Disconnect( ID_MENU_SHOW_LOCALWATCH, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Disconnect( ID_MENU_SHOW_GLOBALWATCH, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Disconnect( ID_MENU_SHOW_REGISTRYWATCH, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Disconnect( ID_MENU_SHOW_ENVIRONWATCH, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Disconnect( ID_MENU_SHOW_STACKWATCH, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Disconnect( ID_MENU_SHOW_WATCH, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Disconnect( ID_MENU_SHOW_BACKTRACEVIEW, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Disconnect( ID_MENU_SHOW_INTERACTIVEVIEW, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Disconnect( ID_MENU_SHOW_OUTPUTVIEW, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Disconnect( ID_MENU_BREAK, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Disconnect( ID_MENU_RESTART, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Disconnect( ID_MENU_STEPOVER, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Disconnect( ID_MENU_STEPINTO, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Disconnect( ID_MENU_STEPRETURN, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	this->Disconnect( ID_MENU_TOGGLE_BREAKPOINT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnMenu ) );
	
}
